package com.huaxia.day9;

/**
 * 创建对象
 */
public class CreateObj {
    public static void main(String[] args) {
       // ClassLoadA a = new ClassLoadA();
        classFor();
    }

    /**
     * 反射创建对象
     */
    static void classFor() {
        try {
            Class cla = Class.forName("com.huaxia.day9.ClassLoadA");
            ClassLoadA a = (ClassLoadA) cla.newInstance();
            a.print();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
